Improve printer distinction for option retrieval
authorMichael Weghorn <m.weghorn@posteo.de>
Thu, 13 Aug 2015 20:31:28 +0000 (22:31 +0200)
committerMarek Kasik <mkasik@redhat.com>
Fri, 11 Sep 2015 13:19:35 +0000 (15:19 +0200)
In order to retrieve the user options for a printer, the respective
printer name is used.
This fixes the comparison of printer names to avoid that the options of
another printer are accidently read whose name starts with the same
letters, but is longer (e.g. "myprinterlongername" instead of
"myprinter").

This fixes Bug 753628.

modules/printbackends/cups/gtkprintbackendcups.c

index 242ba3a09ca9d63f9a81b49f261ab3e3b9f90ea7..44868ddec5450d73de9c6914b53c650e3f9f6ec9 100644 (file)
@@ -3981,7 +3981,7 @@ cups_parse_user_options (const char     *filename,
 
       *lineptr++ = '\0';
 
-      if (strncasecmp (name, printer_name, strlen (printer_name)) != 0)
+      if (strcasecmp (name, printer_name) != 0)
           continue;
 
       /* We found our printer, parse the options */